<!DOCTYPE html>
<style>
    #container {
        text-indent: 100px;
        width: 200px;
        border: 1px solid black;
    }
    #float {
        float: right;
        width: 50px;
        height: 50px;
        background: green;
    }
</style>
<div id="container" dir="RTL">
     <div id="float"></div>
     Some text that should not overlap the edge of the container.
</div>